
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>数据库操作</title>
</head>
<body>
<h1>命令执行结果</h1>
<pre>
<?php
print_r($_POST);
$sqls=$_POST['sql']; //获取用户要执行的多条语句
$sqlArray=preg_split('@;\s*@', $sqls,flags:PREG_SPLIT_NO_EMPTY); //数组，包含每一条语句
print_r($sqlArray);
?>
    </pre>
<hr>
<div class='sql'>use db</div>
<div class='result'>受影响的行数：0</div>
<div class='sql'>show tables</div>
<table><tr><th>序号</th><th>Tables_in_db</th></tr><tr><td>1</td><td>chengyu</td></tr><tr><td>2</td><td>students</td></tr></table>
<div class='sql'>insert into chengyu
    values ('哈哈哈','哈'),('嘻嘻嘻','嘻')</div>
<div class='result'>受影响的行数：2</div>
</body>
</html>



